Loading

×Sorry to interrupt
CSS Error

Refresh

Cookie Preference Center

General Information on cookies

When you visit our website, we use cookies to ensure that we give you the best experience. This information does not usually directly identify you, but it can give you a more personalized web experience. Because we respect your right to privacy, you can choose not to allow some types of cookies by clicking on the different category headings to find out more and change your settings. However, blocking some types of cookies may impact your experience on the site and the services we are able to offer. Further information can be found in our

Cookie Policy.

Strictly Necessary

Strictly Necessary

Always Active

Strictly Necessary

Strictly necessary cookies are always enabled since they are essential for our website to function. They enable core functionality such as security, network management, and website accessibility. You can set your browser to block or alert you about these cookies, but this may affect how the website functions. For more information please visit www.aboutcookies.org or www.allaboutcookies.org.

Cookie Details‎

Performance

Performance

Performance

Performance cookies are used to analyze the user experience to improve our website by collecting and reporting information on how you use it. They allow us to know which pages are the most and least popular, see how visitors move around the site, optimize our website and make it easier to navigate.

Cookie Details‎

Please confirm your settings by refreshing the page.

Functional

Functional

Functional

Functional cookies help us keep track of your past browsing choices so we can improve usability and customize your experience. These cookies enable the website to remember your preferred settings, language preferences, location and other customizable elements such as font or text size. If you do not allow these cookies, then some or all of these services may not function properly.

Cookie Details‎

Advertising

Advertising

Advertising

Advertising cookies are used to send you relevant advertising and promotional information. They may be set through our site by third parties to build a profile of your interests and show you relevant advertisements on other sites. These cookies do not directly store personal information, but their function is based on uniquely identifying your browser and internet device.

Cookie Details‎

Advertising Cookies

Consent Leg.Interest

Select All Vendors

Select All Vendors

Select All Hosts

Select All

Clear Filters

Information storage and access

Apply

Confirm My Choices Reject All Allow All

My Subscriptions

Loading

Knowledge Base

Purging old data from the database used by vCenter Server (1025914)

Last Updated: 3/20/2024Categories: How toTotal Views: 662222Language:
Chinese (Simplified)Portuguese (European)JapaneseSpanishEnglishGerman

30 like this article

Subscribe to get an email
newsletter with new updates

30 people found this helpful Please provide article feedback:

Learn how VMware Skyline Advisor and Skyline Health Diagnostics work together to provide proactive intelligence and self-service log analysis.

Use Skyline Advisor to avoid issues before they occur across VCF, vSphere, vSAN, NSX, vROps & Horizon. Skyline Findings are based on top KBs, VMSAs/CVEs and design best practices.

Use Skyline Health Diagnostics to root cause vSphere & vSAN logs when an issue occurs. Skyline Health Diagnostic Findings are based on top KBs and VMSA/CVEs. You can use the Skyline Health Diagnostics tool in online or offline mode.

If you require additional help from technical support, please use Skyline Advisor to initiate a Log Assist to reduce time to upload logs. TSEs can also initiate logs to reduce effort.

Purpose

If your vCenter Server fails to start, verify if the VPX_EVENT and VPX_TASK tables are full and manually purge the database if required.

When the vCenter Server database if full:

You cannot log in to vCenter Server

VMware VirtualCenter Server service may start and stop immediately.

Microsoft SQL Event log reports the error:

Could not allocate space for object 'dbo.VPX_EVENT'.'VPXI_EVENT_USERNAME' in database 'VCDB' because the 'PRIMARY' filegroup is full. Create disk space by deleting unneeded files, dropping objects in the filegroup, adding additional files to the filegroup, or setting autogrowth on for existing files in the filegroup.

Resolution

Video tutorial for Purging old data from the database used by vCenter Server:

Process to Purge old data from the database used by vCenter Server:

To resolve this issue "vCenter Server fails to start" follow the steps below:

Manually purge the vCenter Server database or

Truncate the vCenter Server database

Caution: VMware recommends that you stop the VMware VirtualCenter Server service and take a full, reliable backup of your database before attempting this process.

Notes:

If you are using SQL 2005 Express, you may need to download and install Microsoft SQL Server Management Studio Express .

SQL Express 2005/2008 (vCenter Server 5.x is bundled with SQL Express 2008) supports a maximum of 5 hosts and 50 virtual machines. If your environment exceeds these thresholds, you must upgrade your database to SQL Standard edition.

The database transaction log may fill up during this procedure if sufficient disk space is not available. For SQL Server, if the required disk space cannot be made available, one option is to utilize the simple recovery model on the database for the duration of this operation.

Process to Purge the Tasks and Event Tables:

Note: If purging of database takes a long time, truncate the event and tasks table to clean up the database.

To purge the data in the VPX_EVENT table:

Connect to Servername\SQL Database and log in with the appropriate credentials.

Click databases to expand and select VIM_VCDB > Tables.

Note: By default, the vCenter Server database is named VIM_VCDB, unless it was renamed during initial creation.

Right-click the dbo.VPX_PARAMETER table and click Open.

Note: If you are using SQL Server 2008, right-click the dbo.VPX_PARAMETER table and click Edit Top 200 Rows.

Modify event.maxAge to 30 and the event.maxAgeEnabled value to true.

Modify task.maxAge to 30 and the task.maxAgeEnabled value to true.

Note: To improve the time of the data cleanup, run the preceding steps in several intervals:

Ensure to keep the default value of event.maxAge and task.maxAge.

Perform step 6 to run the cleanup.

Reduce the event.maxAge and task.maxAge value by 60 and run the cleanup.

Repeat the steps a-c until the value is reached to 30 for the final cleanup process.

Run the built-in stored procedure:

Go to VIM_VCDB > Programmability > Stored Procedures.

Right-click dbo.cleanup_events_tasks_proc and select Execute Stored Procedure.

This purges the data from the vpx_event, vpx_event_arg, and vpx_task tables based on the date specified for maxAge.

When purging is successfully completed, close the SQL Management Studio and start the VMware Virtual Center Server service.

Ensure that the default Statistics Level is set to 1:

Using the vSphere Client, log in to vCenter Server as an administrator.

Go to Administration > vCenter Server Settings > Statistics.

Under Statistics Intervals, ensure the Statistics Level column is set to 1.

To change the value, select the Interval Duration, click Edit and select Level 1 from the list.

Notes:

The execution of dbo.cleanup_events_tasks_proc may take a long period of time depending on the database size.

The operation may fail due to the transaction logs being filled up at multiple intervals based on the data to be purged. You must shrink the Transaction logs when required and run dbo.cleanup_events_tasks_proc again.

Process to Truncate the Event and Tasks Table:

To Truncate the event and tasks table, run this script:

alter table VPX_EVENT_ARG drop constraint FK_VPX_EVENT_ARG_REF_EVENT, FK_VPX_EVENT_ARG_REF_ENTITY
alter table VPX_ENTITY_LAST_EVENT drop constraint FK_VPX_LAST_EVENT_EVENT
truncate table VPX_TASK
truncate table VPX_ENTITY_LAST_EVENT
truncate table VPX_EVENT
truncate table VPX_EVENT_ARG
alter table VPX_EVENT_ARG add constraint FK_VPX_EVENT_ARG_REF_EVENT foreign key(EVENT_ID) references VPX_EVENT (EVENT_ID) on delete cascade,
constraint FK_VPX_EVENT_ARG_REF_ENTITY foreign key (OBJ_TYPE) references VPX_OBJECT_TYPE (ID)
alter table VPX_ENTITY_LAST_EVENT add constraint FK_VPX_LAST_EVENT_EVENT foreign key(LAST_EVENT_ID)
references VPX_EVENT (EVENT_ID) on delete cascade

Disclaimer: VMware is not responsible for the reliability of any data, opinions, advice, or statements made on third-party websites. Inclusion of such links does not imply that VMware endorses, recommends, or accepts any responsibility for the content of such sites.

Related Information

Using the following Microsoft SQL Studio options do not help with purging the VPX_EVENT and VPX_TASK table:

Purging the old data

Truncating tables

Shrinking the logs and database

Recreating Roll up jobs

More Information Here:

How to stop, start, or restart vCenter Server services
"The transaction log for database 'VIM_VCDB' is full" error on a Microsoft SQL DB server
Reducing the size of the vCenter Server database when the rollup scripts take a long time to run
Determining where growth is occurring in the vCenter Server database
How to file a Support Request in Customer Connect
Selective deletion of tasks, events, and historical performance data in vSphere 5.x and 6.x

Read this article in different languages here:
Depurar datos antiguos de la base de datos utilizada por vCenter Server
vCenter Server に使用されているデータベースから古いデータを消去する
Como limpar dados antigos do banco de dados usado pelo vCenter Server
从 vCenter Server 使用的数据库中清除旧数据
ereinigen alter Daten aus der von VMware vCenter Server verwendeten Datenbank

Detectable by VMware SkylineTM

Actions

Copy

link to clipboard
copied!

Print

Language:
Chinese (Simplified)Portuguese (European)JapaneseSpanishEnglishGerman

Attachments

1025914_VCDB_Purge_ORACLE.zip

1025914_VCDB_Purge_MSSQL.zip

Additional Resources

KB
•
End Of General Availability of the Free vSphere Hypervisor (ESXi 7.x and 8.x) (2107518)

Result 1 of 1

Ask The Community

Get answers quickly from VMware experts in the community

Post Subject

CONTINUE IN COMMUNITIES

Related Products:

Related Versions:

Take Our Survey

Support Assistant